<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich">

	<h:panelGrid width="80%" columns="2" columnClasses="introCol1,introCol2">
		<h:outputText value="#{messages['intro.partyid']}:" />
		<h:panelGroup>
			<h:panelGroup id="identGroup">
				<h:inputText id="partyIdentity" value="#{transactionHelper.partyFormalIdentity}" required="true"
				style="width:70%"
				readonly="true"
				requiredMessage="Valor requerido"
				validatorMessage="Valor muy corto">
					<f:validateLength minimum="13" />
					<a4j:support event="onblur" />
				</h:inputText>
			</h:panelGroup>
			#{'   '}
			<a4j:commandLink ajaxSingle="true" oncomplete="#{rich:component('selectPartyPanel')}.show()">
				<f:setPropertyActionListener target="#{personHelper.returnValueField}" value="transactionHelper.party" />
				<f:setPropertyActionListener target="#{personHelper.reRenderComponents}" value="identGroup, partyGroup" />
				<f:setPropertyActionListener target="#{legalPersonHelper.returnValueField}" value="transactionHelper.party" />
				<f:setPropertyActionListener target="#{legalPersonHelper.reRenderComponents}" value="identGroup, partyGroup" />
				<h:outputText value="#{messages['intro.search']}" />
			</a4j:commandLink>
			<br />
			<rich:message style="color:Red;" for="partyIdentity" />
		</h:panelGroup>

		<h:outputText value="#{messages['intro.fullname']}:"/>
		<h:panelGroup id="partyGroup">
			<a4j:region renderRegionOnly="true">
				<h:inputText id="partyName" value="#{transactionHelper.partyName}"
				required="true"
				readonly="true"
				requiredMessage="El nombre es requerido"
				validatorMessage="Nombre muy corto"
				style="width:100%;">
					<f:validateLength minimum="3" />
					<a4j:support event="onblur" />
				</h:inputText>
				<br />
				<rich:message style="color:Red;" for="partyName" />
			</a4j:region>
		</h:panelGroup>

		<h:outputText value="#{messages['intro.cashierscode']}:"/>
		<h:panelGroup>
			<a4j:region renderRegionOnly="true">
				<h:inputText id="cashiersCode" value="#{transactionHelper.transaction.cashiersCode}"
				label="#{messages['intro.cashierscode']}"
				required="true"
				style="width:100%;">
					<a4j:support event="onblur" />
				</h:inputText>
				<br />
				<rich:message style="color:Red;" for="cashiersCode" />
			</a4j:region>
		</h:panelGroup>
		
		<h:outputText value="#{messages['intro.payment']}:"/>
		<h:panelGroup>
			<a4j:region renderRegionOnly="true">
				<h:inputText id="payment" value="#{transactionHelper.transaction.payment}"
				label="#{messages['intro.payment']}"
				required="true"
				requiredMessage="El nombre es requerido"
				validatorMessage="Nombre muy corto"
				style="width:100%;">
					<a4j:support event="onblur" />
				</h:inputText>
				<br />
				<rich:message style="color:Red;" for="payment" />
			</a4j:region>
		</h:panelGroup>
	</h:panelGrid>
	
	<br />
	<br />
	<br />
	
	<h3>
		<h:outputText value="#{messages['intro.description']}:" />
	</h3>
	<rich:separator lineType="solid"/>
	<br />
	<h:panelGroup>
		<a4j:region renderRegionOnly="true">
			<h:inputTextarea id="descripcion" value="#{transactionHelper.transaction.description}" required="true"
			rows="5" style="width:90%"
			requiredMessage="Valor requerido"
			validatorMessage="Valor muy corto">
				<f:validateLength minimum="3" />
				<a4j:support event="onblur" />
			</h:inputTextarea>
			<br />
			<rich:message style="color:Red;" for="descripcion" />
		</a4j:region>
	</h:panelGroup>


</ui:composition>
